﻿
using netRecord;
using AutoMapper;
using var db = new SqlDbContext();
db.Students.Add(new StudentEntity() { Name="lyf", ClassName="三班", Age =18 });
await db.SaveChangesAsync();
var mapperConfig = new MapperConfiguration(cfg=> cfg.AddProfile(new ConfigProfile()));
var mapper = mapperConfig.CreateMapper();

var student = db.Students.FirstOrDefault();
var stuRecord = mapper.Map<StudentRecord>(student);
Console.WriteLine(stuRecord.ToString());
Console.ReadKey();